/*
 * @FilePath: routes.ts
 * @Author: liuqiong
 * @Date: 2023-09-09 10:08:22
 * @LastEditors: yangxn 153159893@qq.com
 * @LastEditTime: 2024-11-29 10:54:48
 * @Description:
 */
import type { RouteRecordRaw } from 'vue-router'

export const children = [
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/Home/index.vue'),
    meta: {
			title: '首页',
    },
  },
  {
    path: '/module1',
    name: 'module1',
    redirect: '/module1/page1',
    meta: {
			title: '模块一',
    },
    children: [
      {
        path: '/module1/page1',
        name: 'page1-1',
        component: () => import('@/views/Module1/Page1/index.vue'),
        meta: {
          title: '页面一',
        },
      },
      {
        path: '/module1/page2',
        name: 'page1-2',
        component: () => import('@/views/Module1/Page2/index.vue'),
        meta: {
          title: '页面二',
        },
      },
    ]
  },
  {
    path: '/module2',
    name: 'module2',
    redirect: '/module2/page1',
    meta: {
			title: '模块二',
    },
    children: [
      {
        path: '/module2/page1',
        name: 'page2-1',
        component: () => import('@/views/Module2/Page1/index.vue'),
        meta: {
          title: '页面一',
        },
      },
      {
        path: '/module2/page2',
        name: 'page2-2',
        component: () => import('@/views/Module2/Page2/index.vue'),
        meta: {
          title: '页面二',
        },
      },
    ]
  },
]

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'layout',
    redirect: 'home',
    component: () => import('@/views/Layout/index.vue'),
    children
  },
  {
    path: '/:pathMatch(.*)*',
    name: '404',
    component: () => import('@/views/404/index.vue'),
  }
]

export default routes